home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar Extras 3
/
Ex3side3.d64
/
letter source
< prev
next >
Wrap
Text File
|
2022-08-28
|
31KB
|
2,930 lines
open =$ffc0
readst =$ffb7
setlfs =$ffba
setnam =$ffbd
setmsg =$ff90
load =$ffd5
getin =$ffe4
input'buffer =512
clrchn =$ffcc
close =$ffc3
chkout =$ffc9
chkin =$ffc6
plot =$fff0
chrout =$ffd2
strout = $ab1e
crsr'down =17
rvs'on =18
home =19
del =20
crsr'right =29
green =30
blue =31
lowercase =14
uppercase =142
rvs'off =146
clr =147
insert =148
brown =149
light'red =150
dark'grey =151
medium'grey =152
light'green =153
top'left =176
top'right =174
bottom'left =173
bottom'right =189
forms'loc =$3300
mail'merge'start =$a000
;dvo 10
.org $0801
.obj "@0:lettermeister"
.byt $0b,$08,$c7,$07,$9e,$32,$30,$36,$31,$00,$00,$00
setup lda #0
sta 53280
sta 53281
sta word'index
sta forms'loc
lda #255
sta cats'found
lda #26
sta 53272
lda #0
sta 212
lda #8
jsr chrout
lda #11
sta 649
lda #clr
jsr chrout
ldx <ban'top
ldy >ban'top
jsr copy'parms
jsr fill'box
ldx <ban'middle
ldy >ban'middle
jsr copy'parms
jsr fill'box
ldx <ban'bottom
ldy >ban'bottom
jsr copy'parms
jsr fill'box
ldy #8
ldx #1
clc
jsr plot
jsr r'patch
lda #3
sta 646
inc 199
lda <ban'text
ldy >ban'text
jsr strout
ldx #4
ldy #0
lda #14
jsr print'framed'box
ldx #21
ldy #0
lda #0
jsr print'framed'box
load'default lda #0
jsr setmsg
lda #2
ldx 186
cpx #8
bcs +
ldx #8
+ stx device
ldy #0
jsr setlfs
lda #6
ldx <filename
ldy >filename
jsr setnam
load'file ldx <loading'msg
ldy >loading'msg
lda #23
jsr show
lda #0
ldx <forms'loc
ldy >forms'loc
inx
jsr load
ldy #0
tya
sta (174),y
ldx #3
jsr screen'stash
jsr open'error
jsr read'error
get'return ldx <getting'ret'mess
ldy >getting'ret'mess
lda #22
jsr show
lda #8
ldx <return'name+3
ldy >return'name+3
jsr setnam
lda #2
ldx device
ldy #2
jsr setlfs
jsr open
ldx #2
jsr chkin
lda return'address
sta 253
lda return'address+1
sta 254
ldy #0
- jsr getin
sta (253),y
iny
bne -
jsr clrchn
lda #2
jsr close
jsr open'error
jsr read'error
ldx #21
ldy #0
lda #0
jsr print'framed'box
jsr find'categories
ldx #0
jsr screen'stash
setup'menu ldx <categories'shadow
ldy >categories'shadow
jsr copy'parms
jsr fill'box
ldx <categories'parms
ldy >categories'parms
jsr copy'parms
jsr fill'box
ldx categories'parms+2
inx
ldy categories'parms
iny
clc
jsr plot
jsr r'patch
ldx #0
stx 254
- lda 254
asl
tax
lda categories,x
sta 251
lda categories+1,x
sta 252
lda #13
sta 646
lda #1
sta 199
ldy #0
- lda (251),y
jsr chrout
cmp #13
beq +
iny
bne -
+ lda #9
sta 211
jsr 58732
jsr r'patch
inc 254
lda 254
cmp cats'found
bne --
ldx <select'prompt
ldy >select'prompt
lda #21
jsr show
lda #8
sta menux1
lda #32
sta menux2
lda categories'parms+2
clc
adc #1
sta menuy
lda cats'found
sta menu'items
lda #13
sta menu'text
lda #1
sta menu'highlight
jsr menu
lda menu'items
sec
sbc #3
cmp menu'current
bne +
jsr set'return
ldx #3
jsr screen'restore
jmp setup'menu
+ clc
adc #1
cmp menu'current
bne +
jmp load'new
+ lda menu'current
tay
iny
cpy menu'items
beq quit'sure
sta current'letter
clear'ram lda #0
sta 251
lda #$f0
sta 252
lda #0
ldy #0
- sta (251),y
inc 251
bne -
inc 252
ldx 252
cpx #$fd
bcc -
jmp get'letter
quit'sure lda #19
ldx <sure'text
ldy >sure'text
jsr show
- jsr getin
beq -
cmp "y"
bne +
jmp quit'loadstar
+ cmp "n"
bne -
jmp setup'menu
get'letter lda current'letter
asl
tax
lda categories,x
sta 247
lda categories+1,x
sta 248
find'letter'start ldy #0
sty word'index
sty bottom'of'letter
sty bottom'of'letter+1
lda edit'menu
sta 249
lda edit'menu+1
sta 250
- lda (247),y
sta (249),y
cmp "\"
beq +
jsr bump'page
inc 249
bne -
inc 250
bne -
+ lda 247
sta top'of'letter
lda 248
sta top'of'letter+1
print'page jsr clear'window
lda #0
sta word'index
print'page'2 ldx #5
ldy #1
sty reverse'flag
clc
jsr plot
jsr r'patch
lda #154
jsr chrout
ldy #0
page'loop ldy #0
lda 248
cmp #$f0
bcc +
jmp blank'loop
+ lda (247),y
bne +
lda 247
sta bottom'of'letter
lda 248
sta bottom'of'letter+1
jmp scan'wait
+ cmp "@"
beq found'letter'bottom
ldx #1
stx 199
cmp "\"
bne +
jmp fill'blank
+ jsr word'wrap
+ ldy #0
ldx 214
cpx #20
bcs page'finished
jsr bump'page
jmp page'loop
woah jmp get'letter
found'letter'bottom lda 247
sta bottom'of'letter
lda 248
sta bottom'of'letter+1
lda #29
ldx <next'letter'msg
ldy >next'letter'msg
jsr show
jmp scan'wait
bump'page inc 247
bne +
inc 248
+ rts
page'finished lda 211
cmp #1
beq +
jsr print'word
+ jsr bump'page
lda #29
ldx <next'letter'msg
ldy >next'letter'msg
jsr show
scan'wait jsr getin
beq scan'wait
cmp #crsr'down
bne +
lda bottom'of'letter+1
bne back'to'letter
jsr clear'window
jmp print'page'2
+ cmp "m"
bne +
jsr zero'stash
ldx #1
jsr screen'stash
lda #255
sta space'on
sta menu'current
jsr prompts'menu
ldx #1
jsr screen'restore
lda #154
jsr chrout
jsr zero'restore
lda space'on
cmp " "
beq back'to'letter
jmp setup'menu
back'to'letter jsr zero'restore
lda top'of'letter
sta 247
lda top'of'letter+1
sta 248
jsr clear'window
ldy #0
sty bottom'of'letter
sty bottom'of'letter+1
jmp print'page
+ cmp " "
bne scan'wait
jsr search'forward
bvc +
jmp get'letter
+ bmi +
jmp get'letter
+ jmp find'letter'start
lda bottom'of'letter+1
beq scan'wait
jsr bump'page
lda #0
sta bottom'of'letter+1
jmp find'letter'start
+ jsr word'wrap
lda word'index
bne +
jsr bump'page
jmp -
+ jmp bump'page
exit ldx #0
jsr screen'restore
quit'loadstar ldy #80
lda #0
- sta input'buffer,y
dey
bpl -
jmp quit
fill'box jsr linx
lda 214
pha
lda 211
pha
box'start ldx box'parameters+2
ldy #0
clc
jsr $fff0
jsr r'patch
dec box'parameters
inc box'parameters+3
- ldy box'parameters+1
- lda box'parameters+4
cmp #255
beq +
sta (209),y
+ lda box'parameters+5
sta (243),y
dey
cpy box'parameters
bne -
lda 214
cmp box'parameters+3
beq +
inc 214
jsr 58732
jsr r'patch
jmp --
+ lda #home
jsr $ffd2
pla
sta 211
pla
sta 214
jmp 58732
copy'parms stx 251
sty 252
ldy #5
- lda (251),y
sta box'parameters,y
dey
bpl -
rts
print'framed'box sta number'of'lines
clc
jsr plot
jsr r'patch
lda <box'top
ldy >box'top
jsr strout
lda number'of'lines
- pha
lda <box'middle
ldy >box'middle
jsr strout
pla
tay
dey
tya
bpl -
lda <box'bottom
ldy >box'bottom
jsr strout
jmp linx
linx ldy #24
- lda 217,y
ora #128
sta 217,y
dey
bpl -
rts
screen'stash txa
and #3
tax
lda screens,x
sta 252
clc
adc #4
sta 254
lda #0
sta 253
sta 251
lda #home
jsr chrout
jsr r'patch
sei
lda #0
sta 1
ldx #3
ldy #0
- lda (209),y
sta (251),y
dec 1
lda (243),y
inc 1
sta (253),y
iny
bne -
inc 210
inc 252
inc 244
inc 254
dex
bpl -
lda #$77
sta 1
cli
lda #home
jmp chrout
screen'restore txa
and #3
tax
lda screens,x
sta 252
clc
adc #4
sta 254
lda #0
sta 253
sta 251
lda #home
jsr chrout
jsr r'patch
sei
lda #0
sta 1
ldx #3
ldy #0
- lda (251),y
sta (209),y
lda (253),y
dec 1
sta (243),y
inc 1
iny
bne -
inc 210
inc 252
inc 244
inc 254
dex
bpl -
lda #$77
sta 1
cli
lda #home
jmp chrout
find'categories lda <forms'loc
sta 251
lda >forms'loc
sta 252
inc 251
ldy #0
sty cats'found
search'plus lda (251),y
beq end'of'data
cmp "{SHIFT-+}"
beq found'category
bump'search'plus inc 251
bne +
inc 252
+ jmp search'plus
found'category lda cats'found
asl
tax
lda 251
sta categories,x
lda 252
sta categories+1,x
inc categories,x
bne +
inc categories+1,x
+ inc cats'found
jmp bump'search'plus
end'of'data lda cats'found
asl
tax
lda <return'text
sta categories,x
lda >return'text
sta categories+1,x
inc cats'found
lda cats'found
asl
tax
lda <user'file'text
sta categories,x
lda >user'file'text
sta categories+1,x
inc cats'found
lda cats'found
asl
tax
lda <quit'text
sta categories,x
lda >quit'text
sta categories+1,x
inc cats'found
rts
menu jsr linx
ldx menuy
ldy #0
sty menu'current
clc
jsr plot
jsr r'patch
ldy menux1
lda menu'highlight
- sta (243),y
iny
cpy menux2
beq -
bcc -
menu'wait jsr getin
beq menu'wait
ldx menu'current
stx temp
cmp #crsr'down
beq menu'down
cmp #145
beq menu'up
cmp #13
beq menu'select
bit space'on
bpl menu'wait'loop
cmp " "
beq menu'select
menu'wait'loop jmp menu'wait
menu'down inc menu'current
lda menu'current
cmp menu'items
bne highlight
lda #0
sta menu'current
jmp highlight
menu'up dec menu'current
lda menu'current
cmp #255
beq +
jmp highlight
+ ldy menu'items
dey
sty menu'current
jmp highlight
menu'select sta space'on
rts
highlight lda menuy
clc
adc menu'current
tax
ldy #0
clc
jsr plot
jsr r'patch
lda menu'highlight
sta mcolor
jsr paint'line
lda